<?php

/**
 * LotFacturation form base class.
 *
 * @method LotFacturation getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLotFacturationForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'lof_id'                     => new sfWidgetFormInputHidden(),
      'lot_id'                     => new sfWidgetFormInputText(),
      'lof_libelle'                => new sfWidgetFormInputText(),
      'lof_montant_ht'             => new sfWidgetFormInputText(),
      'lof_charge_jh'              => new sfWidgetFormInputText(),
      'lof_date_prev_pv_reception' => new sfWidgetFormDateTime(),
      'lof_date_reel_pv_reception' => new sfWidgetFormDateTime(),
      'lof_commentaire'            => new sfWidgetFormInputText(),
      'lof_est_facture'            => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'lof_id'                     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('lof_id')), 'empty_value' => $this->getObject()->get('lof_id'), 'required' => false)),
      'lot_id'                     => new sfValidatorInteger(),
      'lof_libelle'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'lof_montant_ht'             => new sfValidatorNumber(array('required' => false)),
      'lof_charge_jh'              => new sfValidatorNumber(array('required' => false)),
      'lof_date_prev_pv_reception' => new sfValidatorDateTime(array('required' => false)),
      'lof_date_reel_pv_reception' => new sfValidatorDateTime(array('required' => false)),
      'lof_commentaire'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'lof_est_facture'            => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('lot_facturation[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LotFacturation';
  }

}
